package com.manner.groupon.controller.admin;

import com.manner.groupon.common.BaseResponse;
import com.manner.groupon.service.groupon.GrouponCouponsService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: Manner
 * @Description: 后台管理员对团购优惠券的操作请求控制器
 * @DateTime: 2024/11/10 16:20
 */
@RestController("adminGrouponCouponsController")
@RequestMapping("/admin/groupon_coupons")
@RequiredArgsConstructor
public class GrouponCouponsController {

    private final GrouponCouponsService grouponCouponsService;

    /**
     * @param grouponCouponsId
     * @param statusCode
     * @return BaseResponse
     * @description: 管理员审核平台内部员工上架的团购优惠券信息
     * @author Manner
     * @date 2024/11/10 16:27
     */
    @PostMapping("/examine/{gcId}/{code}")
    public BaseResponse toExamine(@PathVariable("gcId") Long grouponCouponsId, @PathVariable("code") Integer statusCode) {
        return grouponCouponsService.toExamineUpdate(grouponCouponsId, statusCode);
    }
}
